package com.zjtobacco.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zjtobacco.domain.Floor;
import com.zjtobacco.domain.Region;
import com.zjtobacco.domain.Warehouse;
import com.zjtobacco.service.BaseService;
import com.zjtobacco.service.FloorService;
import com.zjtobacco.service.RegionService;
import com.zjtobacco.service.WarehouseService;
@Controller
@RequestMapping("/floor")
public class FloorController extends BaseController<Floor, Integer> {

	@Autowired
	private FloorService floorService;
	@Autowired
	private WarehouseService  warehouseService;
	@Autowired
	private RegionService  regionService;
	@Override
	BaseService<Floor, Integer> getBaseService() {
		return this.floorService;
	}
	public void addDataForEditView(ModelAndView modelAndView) throws Exception {
		List<Warehouse> allWarehouseList = warehouseService.list(null);
		modelAndView.addObject("allWarehouseList",allWarehouseList);
		List<Region> allRegionList = regionService.list(null);
		modelAndView.addObject("allRegionList",allRegionList);
	}

}
